A conventional type of communication network is described here. FIG. 16 is a view showing a conventional type of communication network disclosed, for instance, in Japanese Patent Publication No. HEI 5-42209. In this figure reference numeral 1 indicates a master device, and reference numeral 2 indicates a slave device. The master device 1 and slave device 2 are connected to each other with an interactive transfer path. Assuming that a sampling cycle is T, information sampled at sampling time T is transmitted to each other according to the sampling time.
In order to match the sampling time in the master device 1 to that in the slave device 2, information for matching the sampling time is periodically inserted into the sampling information for transmission. A mismatch in the sampling time may be generated during booting of the devices, or when there is a breakdown, or due to a difference in the operation clock frequency in the master device and in the slave device.
A procedure for matching the sampling time in the master device 1 to that in the slave device 2 is explained here. FIG. 17 is a view showing an example of a timing chart showing a flow of information between the master device 1 and slave device 2 in a communication network based on the conventional technology.
In FIG. 17 reference numeral 3 indicates descending sampling information transmitted from the master device 1 to the slave device 2, and reference numeral 4 indicates ascending sampling information transmitted from the slave device 2 to the master device 1. The example shown in this figure is based on the following four assumptions. The first assumption is that sampling information transmitted from the master device 1 or the slave device 2 at each local sampling time only contains the information for matching the sampling time.
The second assumption is that the master device 1 and slave device 2 repeatedly generate a sampling number having a value from 0 to 11 at each sampling cycle T and insert this sampling number into the sampling information to be transmitted. The third assumption is that sampling time in the master device 1 is offset by ΔT from that in the slave device 2 and further a sampling number in the former is offset by 6 from that in the latter. The fourth assumption is that a transfer delay time Td in the transfer path is identical in both the directions.
Flow of information between the master device 1 and the slave device 2 in a communication network based on the conventional technology will be explained while referring to FIG. 17. At first, the master device 1 transmits descending sampling information 3 including information for starting the sampling time matching to the slave device 2 at each local sampling time having the sampling number of 0.
The slave device 2 receives the descending sampling information 3 after passage of the transfer delay time Td and calculates a time interval Ts from the local sampling time (sampling number 9 in FIG. 17) just before receiving the descending sampling information 3 until the time point when the information 3 is received.
The slave 2 then transmits the ascending sampling information 4 including the calculated time interval Ts to the master device 1 at local sampling time (sampling number 10 in FIG. 17) next to that when the descending sampling information 3 is received.
Finally, The master device 1 receives the ascending information 4 after passage of the transfer delay time Td and calculates a time interval Tm from the local sampling time just before the sampling information 4 is received (sampling number 7 in FIG. 17) until the sampling information 4 is received.
As understood from the example shown in FIG. 17, a relation between the transfer delay time Td, the measured time Ts, and Tm is as expressed by the following equations:Td+ΔT=N×T+Ts  (1) Td=M×T+Tm+ΔT  (2) 
Herein N is a number of sampling cycles from sampling time in the slave device 2 closest to the time point when the descending sampling information 3 is received by the master device 1 until the sampling time as a reference when the slave device 2 measures the time interval Ts. M is a number of sampling cycles from the sampling time in the master device 1 closest to the time point when the slave device 2 transmits the sampling information 4 until the sampling time as a reference when the master device 1 measures the time interval Tm. Accordingly, the following equation is obtained from the equations (1) and (2).ΔT=(N−M)×T/2+(Ts−Tm)/2  (3) 
Values of N and M in the equations (1) and (2) are obtained from a sampling number SA2 (7 in FIG. 17) at the local sampling time just before the ascending sampling information 4 is received by the master device 1 according to the following equations. For instance, when SA2 is odd, thenM=(SA2−1)/2, N=(SA2−1)/2  (4) when SA2 is even and Tm is larger than Ts, thenM=SA2/2, N=SA2/2−1  (5) when SA2 is even and Tm is smaller than Ts, thenM=SA2/2−1, N=SA2/2  (6) 
Accordingly the master device 1 decides AT through the equations (3) to (6), and adjusts the local sampling time in such a way that ΔT becomes zero. In the example shown in FIG. 17, since SA2 is equal to 7, N becomes 3 and M becomes 3, and ΔT is decided through the equation of ΔT=(Ts−Tm)/2. Fine adjustment of sampling time in the master device 1 and slave device 2 is executed as described above.
A method of matching the sampling number for roughly adjusting the sampling time is explained here. For instance, delay ε of a sampling number in the master device 1 from that in the slave device 2 is decided from the sampling number RA1 (10 in FIG. 17) inserted by the slave device 2 into the ascending sampling information and SA2 explained above through the following equation:ε=RA1−(SA2+1)/2  (7) 
The master device 1 decides ε through the equation (7), and advances the local sampling number in such a way that ε becomes zero. In the example of FIG. 17, SA2 is 7 and RA1 is 10 so that ε becomes 6. When ε obtained through the equation (7) is a negative, it indicates that a sampling number in the master device 1 is faster than that in the slave device 2. With the procedure described above, it is possible to match the sampling number in the master device 1 to that in the slave device 2.
A method of expanding a conventional type of communication network as described above to a large-scale communication network in which sampling time in a master device is matched to that in each of a plurality of slave devices and also the master device collects sampling information from the plurality of slave devices is explained here. As shown, for instance, in FIG. 1, one or more units of packet multiplexers are provided between the master device and the plurality of slave devices to form a tree-formed large-scale communication network.
In FIG. 1, reference numeral 6 indicates a master device for collecting sampling information from each of the slave devices and executing communications for matching the sampling time according to that in each slave device. Reference numeral 7 indicates a plurality of slave devices each for transmitting the sampling information to the master device 6 and also executing communications for matching the sampling time. Reference numeral 8 indicates packet multiplexer. Two packets as explained below are transacted between the master device 6 and slave device 7.
The first packet is a general packet indicating the sampling information, and the second packet is a specific packet used for communications for matching the sampling time. Packets transacted between the master device 6 and slave device 7 are classified to general packets and specific packets so that communications for matching the sampling time is preferentially executed prior to collection of sampling information and a transfer delay time in transfer from the master device to the slave device is equalized to that in the reverse direction to satisfy the equation (3).
For instance, as a method of preferentially executing communicating for matching the sampling time, there is a method of providing a buffer for each priority in the packet multiplexer 8. As an example, FIG. 18 shows the internal configuration of the packet multiplexer 8 based on the conventional technology disclosed in Japanese Patent Laid-Open Publication No. HEI 7-131465.
In FIG. 18, reference numeral 11 indicates a master-side port, 12 indicates a slave-side port, 13 indicates a transfer path terminating circuit for terminating a packet transmitted to or from a transfer path at a physical layer level. Reference numeral 14 indicates a general packet multiplexing bus, 15 indicates a specific packet multiplexing bus. Reference numeral 16 indicates a general packet buffer for storing therein a general packet received from the slave-side port, reference numeral 17 indicates a specific packet buffer for storing a specific packet received from the slave-side port, and reference numeral 18 indicates a buffer selection circuit. It should be noted that a circuit for relay from the master-side port to the slave-side port is not shown.
A method of priority control for the packet multiplexer 8 based on the conventional technology is explained here. At first, the transfer path terminating circuit 13 provided in the slave-side port 12 classifies the packets received from the slave-side port 12 to general packets and specific packets. The classified general packets are stored via the general packet multiplexing bus 14 in the general packet buffer 16, while the classified specific packets are stored via the specific packet multiplexing bus 15 in the specific packet buffer 17. When a specific packet is stored in the specific packet buffer 17, the buffer selection circuit 18 controls the specific packet buffer 17 so that the specific packet is preferentially outputted to the master-side port 11 prior to the output of the general packets stored in the general packet buffer 16.
By executing the method for priority control to all of the slave devices, in the communication network based on the conventional technology, in communications for setting sampling time, a transfer delay time in the master device 6 can substantially be matched with that in the slave device 7.
In the communication network based on the conventional technology, however, following problems occur when the packet multiplexer as described above is used.
For instance, when a specific packet arrives from another slave-side port while a general packet from a slave-side port is being relayed to a master-side port, the time required for queuing until relay of the specific packet can be relayed is at the maximum a time required for relaying one general packet and at the minimum zero, and thus the queuing time varies within this range.
Further, when specific packets arrive from a plurality of slave-side ports simultaneously, a time for queuing required until a specific packet is relayed is at the maximum a product of a time required for relaying one packet by a number of slave-side ports and at the minimum zero, and thus the time varies within this range.
As described above, fluctuation of a transfer delay time (the time required for the above explained queuing) increases in proportion to a number of packet multiplexers through which specific information passes through.
Briefly the problem described above can be expressed by the following equation:Fluctuation of a transfer delay time due to queuing for transmission from a slave device to a master device=(a time required for the relay of General packet+a time required for the relay of specific packet×a number of slave-side ports)×number of packet multiplexers which pass the specific information  (8) 
On the other hand, a time for queuing when a specific packet is relayed from a master-side port in a packet multiplexer to a slave-side device is zero, namely fluctuation of a transfer delay time due to queuing for relay from a master device to a slave device is zero regardless of a number of packet multiplexers through which a specific packet passes.
Accordingly, the equation (3) is not satisfied because a transfer delay time from a master device to a slave device is different from that in the reverse direction, and in addition, a correction can not be added to equation (3) because of fluctuation of a transfer delay time due to a time required for packet relay from a master device to a slave device as expressed by the equation (8). Therefore, there is a problem that precision in sampling time for packet relay between a master device and slave devices equivalent to what has been expressed in the equation (8).
It should be noted that a major portion of fluctuation in a delay time in transfer between devices is generated due to the time required for queuing as described above, and in addition, as a phase of an operating clock varies device by device, so that the delay is generated also due to adjustment of the phase. However, the percentage is small as compared to that due to the time required for queuing.